k1<-read.table("results_100permutation_cis_numbers",sep="\t")
pdf("histogram_cis.pdf")
k<-k1[3:nrow(k1),]
i<-1
while(i<ncol(k))
{
	print(i)
	main<-"histogram_permutation_pval_lessthan_"
	main<-paste(main,k1[1,i],sep="_")
	min<-min(k[,i])
	max<-max(k[,i])
	factor<-((max-min)/10)
	#breaks=seq(min-factor,max,factor)
	#print(breaks)
	if(max !=0)
	{	
	#hist(k[,i],breaks=seq(min-factor,max,factor),main=main,xlab="Number of SNPS less than threshold pvalue",ylab ="counts",xlim=c(0,500),ylim=c(0,1200))
	hist(k[,i],breaks=seq(min-factor,max,factor),main=main,xlab="Number of SNPS less than threshold pvalue",ylab ="counts")	
	abline(v=k1[2,i],col=4)
	}
	i<-i+1
}
dev.off()
